{template 'common/header'}
	<ul class="nav nav-tabs">
		<li class="active">
			<a href="">拼车管理</a>
		</li>
	</ul>

	<div style="padding:15px;">
		<table class="table table-hover table-striped">
			<thead>
				<tr>
					<th class="col-sm-1">编号</th>
					<th class="col-sm-2">标题</th>
					<th class="col-sm-2">出发地->目的地</th>
					<th class="col-sm-2">开车时间</th>
					<th class="col-sm-2">可载人数</th>
					<th class="col-sm-2">价格(元/人)</th>
					<th class="col-sm-3">操作</th>
				</tr>
			</thead>
			<tbody>
				{loop $list $cars}
				<tr>
					<td>{$cars['id']}</td>
					<td>{$cars['title']}</td>
					<td>{$cars['start_position']}->{$cars['end_position']}</td>
					<td>{php echo date('Y',TIMESTAMP)}-{$cars['month']}-{$cars['yday']} {$cars['startMinute']}:{$cars['startSeconds']}</td>
					<td>{$cars['seat']}</td>
					<td>{if $cars['sprice']}{$cars['sprice']}{else}按实分摊{/if}</td>
					<td>
						<a onclick="toblack('{$cars['id']}')" href="#" ><i class="fa fa-eye-slash"></i>信息加入黑名单</a>
						&nbsp;
						<a onclick="QIYUE.delete('{$cars['id']}')" href="#" class="text-danger m-r">
							<i class="fa fa-times"></i> 删除 
						</a>
						
					</td>
				</tr>
				{/loop}
			</tbody>
		</table>
	</div>
	{$pager}
	<script type="text/javascript">
	    var QIYUE = {
	        delete: function(id){
	            var id = id;
	            if(!id) return false;
	            $.post("{php echo $this->createWebUrl('carpool')}", {"op":"delete","id":id}, function(msg){
	                var _obj = JSON.parse(msg);
	                if(_obj.state==1){
	                    location.reload();
	                }
	            });
	        }
	    }
	    function toblack(id){
	    	var id = id;
	            if(!id) return false;
	            $.post("{php echo $this->createWebUrl('carpool')}", {"op":"toblack","id":id}, function(msg){
	                var _obj = JSON.parse(msg);
	                if(_obj.state==1){
	                   location.reload();
	                }
	            });
	    }
	</script>
{template 'common/footer'}